home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / D-G / DragDemo.sit / DragDemo.c < prev    next >
MacBinary  |  1995-01-29  |  10.1 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sun Jan 29 16:37:20 1995, modified Sun Jan 29 16:37:20 1995, creator Think C, type ASCII, 9836 bytes "DragDemo.c" , at 0x26ec 346 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 44 72 61 67 44 65 | 6d 6f 2e 63 00 00 00 00 |..DragDe|mo.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 26 6c 00 | 00 01 5a ab 51 bb 10 ab |.....&l.|..Z.Q...|
|00000060| 51 bb 10 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |Q.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 b7 cb 00 00 |........|........|
|00000080| 2f 2f 0d 2f 2f 09 44 72 | 61 67 44 65 6d 6f 0d 2f |//.//.Dr|agDemo./|
|00000090| 2f 0d 2f 2f 09 62 79 20 | 54 69 6d 20 54 6f 6d 6b |/.//.by |Tim Tomk|
|000000a0| 69 6e 73 6f 6e 0d 2f 2f | 09 31 2f 32 39 2f 39 35 |inson.//|.1/29/95|
|000000b0| 0d 2f 2f 0d 2f 2f 09 54 | 68 69 73 20 70 72 6f 67 |.//.//.T|his prog|
|000000c0| 72 61 6d 20 64 65 6d 6f | 6e 73 74 72 61 74 65 73 |ram demo|nstrates|
|000000d0| 20 68 6f 77 20 74 6f 20 | 64 72 61 67 20 61 20 77 | how to |drag a w|
|000000e0| 69 6e 64 6f 77 20 63 6f | 72 72 65 63 74 6c 79 20 |indow co|rrectly |
|000000f0| 28 61 6e 64 20 6e 6f 74 | 20 73 6f 20 63 6f 72 72 |(and not| so corr|
|00000100| 65 63 74 6c 79 29 2e 20 | 20 49 66 20 74 68 65 0d |ectly). | If the.|
|00000110| 2f 2f 09 77 69 6e 64 6f | 77 27 73 20 74 69 74 6c |//.windo|w's titl|
|00000120| 65 20 62 61 72 20 69 73 | 20 63 6c 69 63 6b 65 64 |e bar is| clicked|
|00000130| 2c 20 74 68 65 20 77 69 | 6e 64 6f 77 20 69 73 20 |, the wi|ndow is |
|00000140| 64 72 61 67 67 65 64 20 | 69 6e 20 74 68 65 20 73 |dragged |in the s|
|00000150| 74 61 6e 64 61 72 64 20 | 77 61 79 2e 20 20 49 66 |tandard |way. If|
|00000160| 20 74 68 65 20 63 6f 6e | 74 65 6e 74 0d 2f 2f 09 | the con|tent.//.|
|00000170| 72 65 67 69 6f 6e 20 6f | 66 20 74 68 65 20 77 69 |region o|f the wi|
|00000180| 6e 64 6f 77 20 69 73 20 | 63 6c 69 63 6b 65 64 2c |ndow is |clicked,|
|00000190| 20 74 68 65 20 77 69 6e | 64 6f 77 20 69 73 20 64 | the win|dow is d|
|000001a0| 72 61 67 67 65 64 20 69 | 6e 20 22 72 65 61 6c 2d |ragged i|n "real-|
|000001b0| 74 69 6d 65 22 2c 20 6d | 65 61 6e 69 6e 67 20 74 |time", m|eaning t|
|000001c0| 68 61 74 20 74 68 65 0d | 2f 2f 09 77 69 6e 64 6f |hat the.|//.windo|
|000001d0| 77 20 69 74 73 65 6c 66 | 20 69 73 20 6d 6f 76 65 |w itself| is move|
|000001e0| 64 20 77 69 74 68 20 74 | 68 65 20 63 75 72 73 6f |d with t|he curso|
|000001f0| 72 2c 20 6e 6f 74 20 6a | 75 73 74 20 61 20 64 6f |r, not j|ust a do|
|00000200| 74 74 65 64 20 6f 75 74 | 6c 69 6e 65 20 6f 66 20 |tted out|line of |
|00000210| 74 68 65 20 77 69 6e 64 | 6f 77 2c 20 77 68 69 6c |the wind|ow, whil|
|00000220| 65 20 74 68 65 0d 2f 2f | 09 62 61 63 6b 67 72 6f |e the.//|.backgro|
|00000230| 75 6e 64 20 63 6f 6e 74 | 69 6e 75 6f 75 73 6c 79 |und cont|inuously|
|00000240| 20 75 70 64 61 74 65 73 | 20 69 74 73 65 6c 66 2e | updates| itself.|
|00000250| 0d 2f 2f 0d 2f 2f 09 49 | 6e 20 61 64 64 69 74 69 |.//.//.I|n additi|
|00000260| 6f 6e 20 74 6f 20 77 69 | 6e 64 6f 77 20 64 72 61 |on to wi|ndow dra|
|00000270| 67 67 69 6e 67 2c 20 69 | 74 20 64 65 6d 6f 6e 73 |gging, i|t demons|
|00000280| 74 72 61 74 65 73 20 6f | 74 68 65 72 20 63 6f 6d |trates o|ther com|
|00000290| 6d 6f 6e 20 4d 61 63 69 | 6e 74 6f 73 68 20 74 61 |mon Maci|ntosh ta|
|000002a0| 73 6b 73 2c 20 69 2e 65 | 2e 20 73 65 74 74 69 6e |sks, i.e|. settin|
|000002b0| 67 0d 2f 2f 09 75 70 20 | 61 20 62 61 73 69 63 20 |g.//.up |a basic |
|000002c0| 65 76 65 6e 74 20 6c 6f | 6f 70 2c 20 64 72 61 77 |event lo|op, draw|
|000002d0| 69 6e 67 20 74 68 65 20 | 6d 65 6e 75 20 62 61 72 |ing the |menu bar|
|000002e0| 2c 20 64 69 73 70 6c 61 | 79 69 6e 67 20 61 20 70 |, displa|ying a p|
|000002f0| 69 63 74 75 72 65 20 69 | 6e 20 61 20 77 69 6e 64 |icture i|n a wind|
|00000300| 6f 77 2c 20 68 61 6e 64 | 6c 69 6e 67 0d 2f 2f 09 |ow, hand|ling.//.|
|00000310| 75 70 64 61 74 65 20 65 | 76 65 6e 74 73 2c 20 65 |update e|vents, e|
|00000320| 74 63 2e 0d 2f 2f 0d 2f | 2f 09 59 6f 75 20 63 61 |tc..//./|/.You ca|
|00000330| 6e 20 75 73 65 20 79 6f | 75 72 20 6f 77 6e 20 70 |n use yo|ur own p|
|00000340| 69 63 74 75 72 65 20 62 | 79 20 72 65 70 6c 61 63 |icture b|y replac|
|00000350| 69 6e 67 20 50 49 43 54 | 20 72 65 73 6f 75 72 63 |ing PICT| resourc|
|00000360| 65 20 31 32 38 2c 20 6f | 72 20 62 79 20 61 64 64 |e 128, o|r by add|
|00000370| 69 6e 67 20 61 20 6e 65 | 77 20 70 69 63 74 75 72 |ing a ne|w pictur|
|00000380| 65 0d 2f 2f 09 61 6e 64 | 20 63 68 61 6e 67 69 6e |e.//.and| changin|
|00000390| 67 20 74 68 65 20 63 6f | 6e 73 74 61 6e 74 20 22 |g the co|nstant "|
|000003a0| 6b 50 69 63 74 75 72 65 | 49 44 22 20 62 65 6c 6f |kPicture|ID" belo|
|000003b0| 77 2e 20 20 59 6f 75 20 | 6d 61 79 20 6e 65 65 64 |w. You |may need|
|000003c0| 20 74 6f 20 69 6e 63 72 | 65 61 73 65 20 74 68 65 | to incr|ease the|
|000003d0| 20 6d 65 6d 6f 72 79 20 | 70 61 72 74 69 74 69 6f | memory |partitio|
|000003e0| 6e 0d 2f 2f 09 73 69 7a | 65 20 69 66 20 79 6f 75 |n.//.siz|e if you|
|000003f0| 20 75 73 65 20 61 20 6c | 61 72 67 65 72 20 70 69 | use a l|arger pi|
|00000400| 63 74 75 72 65 2e 0d 2f | 2f 0d 2f 2f 09 54 68 69 |cture../|/.//.Thi|
|00000410| 73 20 66 69 6c 65 20 69 | 73 20 66 6f 72 6d 61 74 |s file i|s format|
|00000420| 74 65 64 20 69 6e 20 54 | 69 6d 65 73 20 31 32 2c |ted in T|imes 12,|
|00000430| 20 74 61 62 20 73 74 6f | 70 73 20 34 2e 0d 2f 2f | tab sto|ps 4..//|
|00000440| 0d 2f 2f 09 54 68 69 73 | 20 70 72 6f 67 72 61 6d |.//.This| program|
|00000450| 20 69 73 20 69 6e 20 74 | 68 65 20 70 75 62 6c 69 | is in t|he publi|
|00000460| 63 20 64 6f 6d 61 69 6e | 2e 20 20 50 6c 65 61 73 |c domain|. Pleas|
|00000470| 65 20 73 65 6e 64 20 63 | 6f 72 72 65 73 70 6f 6e |e send c|orrespon|
|00000480| 64 65 6e 63 65 20 74 6f | 20 22 74 74 6f 6d 6b 69 |dence to| "ttomki|
|00000490| 6e 73 6f 6e 40 61 6f 6c | 2e 63 6f 6d 22 2e 0d 2f |nson@aol|.com"../|
|000004a0| 2f 0d 0d 0d 2f 2f 09 43 | 6f 6e 73 74 61 6e 74 73 |/...//.C|onstants|
|000004b0| 0d 0d 23 64 65 66 69 6e | 65 20 6b 57 69 6e 64 6f |..#defin|e kWindo|
|000004c0| 77 49 44 09 31 32 38 09 | 09 09 09 2f 2f 20 20 74 |wID.128.|...// t|
|000004d0| 68 65 20 77 69 6e 64 6f | 77 27 73 20 72 65 73 6f |he windo|w's reso|
|000004e0| 75 72 63 65 20 49 44 0d | 23 64 65 66 69 6e 65 20 |urce ID.|#define |
|000004f0| 6b 41 62 6f 75 74 49 44 | 09 09 31 32 38 09 09 09 |kAboutID|..128...|
|00000500| 09 2f 2f 20 20 74 68 65 | 20 41 62 6f 75 74 20 62 |.// the| About b|
|00000510| 6f 78 27 73 20 72 65 73 | 6f 75 72 63 65 20 49 44 |ox's res|ource ID|
|00000520| 0d 23 64 65 66 69 6e 65 | 20 6b 50 69 63 74 75 72 |.#define| kPictur|
|00000530| 65 49 44 09 09 31 32 38 | 09 09 09 09 2f 2f 20 20 |eID..128|....// |
|00000540| 74 68 65 20 70 69 63 74 | 75 72 65 27 73 20 72 65 |the pict|ure's re|
|00000550| 73 6f 75 72 63 65 20 49 | 44 0d 23 64 65 66 69 6e |source I|D.#defin|
|00000560| 65 20 6b 41 62 6f 75 74 | 50 69 63 49 44 09 31 32 |e kAbout|PicID.12|
|00000570| 39 09 09 09 09 2f 2f 20 | 20 74 68 65 20 41 62 6f |9....// | the Abo|
|00000580| 75 74 20 62 6f 78 27 73 | 20 70 69 63 74 75 72 65 |ut box's| picture|
|00000590| 20 72 65 73 6f 75 72 63 | 65 20 49 44 0d 23 64 65 | resourc|e ID.#de|
|000005a0| 66 69 6e 65 20 6b 4d 65 | 6e 75 42 61 72 49 44 09 |fine kMe|nuBarID.|
|000005b0| 31 32 38 09 09 09 09 2f | 2f 20 20 74 68 65 20 6d |128..../|/ the m|
|000005c0| 65 6e 75 20 62 61 72 27 | 73 20 72 65 73 6f 75 72 |enu bar'|s resour|
|000005d0| 63 65 20 49 44 0d 23 64 | 65 66 69 6e 65 20 6b 41 |ce ID.#d|efine kA|
|000005e0| 70 70 6c 65 4d 65 6e 75 | 49 44 09 31 32 38 09 09 |ppleMenu|ID.128..|
|000005f0| 09 09 2f 2f 20 20 74 68 | 65 20 41 70 70 6c 65 20 |..// th|e Apple |
|00000600| 6d 65 6e 75 27 73 20 72 | 65 73 6f 75 72 63 65 20 |menu's r|esource |
|00000610| 49 44 0d 23 64 65 66 69 | 6e 65 20 6b 46 69 6c 65 |ID.#defi|ne kFile|
|00000620| 4d 65 6e 75 49 44 09 31 | 32 39 09 09 09 09 2f 2f |MenuID.1|29....//|
|00000630| 20 20 74 68 65 20 46 69 | 6c 65 20 6d 65 6e 75 27 | the Fi|le menu'|
|00000640| 73 20 72 65 73 6f 75 72 | 63 65 20 49 44 0d 23 64 |s resour|ce ID.#d|
|00000650| 65 66 69 6e 65 20 6b 4d | 61 78 57 61 69 74 09 09 |efine kM|axWait..|
|00000660| 30 78 37 46 46 46 46 46 | 46 46 09 09 2f 2f 20 20 |0x7FFFFF|FF..// |
|00000670| 77 61 69 74 20 74 69 6d | 65 20 66 6f 72 20 22 57 |wait tim|e for "W|
|00000680| 61 69 74 4e 65 78 74 45 | 76 65 6e 74 28 29 22 0d |aitNextE|vent()".|
|00000690| 0d 2f 2f 09 47 6c 6f 62 | 61 6c 20 76 61 72 69 61 |.//.Glob|al varia|
|000006a0| 62 6c 65 73 0d 0d 50 69 | 63 48 61 6e 64 6c 65 09 |bles..Pi|cHandle.|
|000006b0| 67 50 69 63 74 75 72 65 | 3b 09 09 09 09 2f 2f 20 |gPicture|;....// |
|000006c0| 20 74 68 65 20 70 69 63 | 74 75 72 65 0d 57 69 6e | the pic|ture.Win|
|000006d0| 64 6f 77 50 74 72 09 67 | 57 69 6e 64 6f 77 3b 09 |dowPtr.g|Window;.|
|000006e0| 09 09 2f 2f 20 20 74 68 | 65 20 77 69 6e 64 6f 77 |..// th|e window|
|000006f0| 0d 42 6f 6f 6c 65 61 6e | 09 09 67 44 6f 6e 65 20 |.Boolean|..gDone |
|00000700| 3d 20 46 41 4c 53 45 3b | 09 09 2f 2f 20 20 70 72 |= FALSE;|..// pr|
|00000710| 6f 67 72 61 6d 20 74 65 | 72 6d 69 6e 61 74 69 6f |ogram te|rminatio|
|00000720| 6e 20 66 6c 61 67 0d 45 | 76 65 6e 74 52 65 63 6f |n flag.E|ventReco|
|00000730| 72 64 09 67 54 68 65 45 | 76 65 6e 74 3b 09 09 09 |rd.gTheE|vent;...|
|00000740| 2f 2f 20 20 65 76 65 6e | 74 20 72 65 63 6f 72 64 |// even|t record|
|00000750| 0d 0d 0d 76 6f 69 64 20 | 54 6f 6f 6c 62 6f 78 49 |...void |ToolboxI|
|00000760| 6e 69 74 20 28 76 6f 69 | 64 29 0d 0d 2f 2f 09 54 |nit (voi|d)..//.T|
|00000770| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 69 6e 69 |his func|tion ini|
|00000780| 74 69 61 6c 69 7a 65 73 | 20 74 68 65 20 4d 61 63 |tializes| the Mac|
|00000790| 69 6e 74 6f 73 68 20 54 | 6f 6f 6c 62 6f 78 2e 20 |intosh T|oolbox. |
|000007a0| 20 49 74 20 73 68 6f 75 | 6c 64 20 62 65 20 63 61 | It shou|ld be ca|
|000007b0| 6c 6c 65 64 20 61 74 20 | 74 68 65 20 62 65 67 69 |lled at |the begi|
|000007c0| 6e 6e 69 6e 67 20 6f 66 | 20 65 76 65 72 79 20 70 |nning of| every p|
|000007d0| 72 6f 67 72 61 6d 2e 0d | 0d 7b 0d 09 49 6e 69 74 |rogram..|.{..Init|
|000007e0| 47 72 61 66 20 28 26 74 | 68 65 50 6f 72 74 29 3b |Graf (&t|hePort);|
|000007f0| 09 09 09 09 2f 2f 20 20 | 69 6e 69 74 69 61 6c 69 |....// |initiali|
|00000800| 7a 65 73 20 51 75 69 63 | 6b 44 72 61 77 0d 09 49 |zes Quic|kDraw..I|
|00000810| 6e 69 74 46 6f 6e 74 73 | 20 28 29 3b 09 09 09 09 |nitFonts| ();....|
|00000820| 09 2f 2f 20 20 69 6e 69 | 74 69 61 6c 69 7a 65 73 |.// ini|tializes|
|00000830| 20 74 68 65 20 46 6f 6e | 74 20 4d 61 6e 61 67 65 | the Fon|t Manage|
|00000840| 72 0d 09 46 6c 75 73 68 | 45 76 65 6e 74 73 20 28 |r..Flush|Events (|
|00000850| 65 76 65 72 79 45 76 65 | 6e 74 2c 20 30 29 3b 09 |everyEve|nt, 0);.|
|00000860| 09 2f 2f 20 20 72 65 6d | 6f 76 65 73 20 61 6c 6c |.// rem|oves all|
|00000870| 20 70 65 6e 64 69 6e 67 | 20 65 76 65 6e 74 73 20 | pending| events |
|00000880| 66 72 6f 6d 20 74 68 65 | 20 65 76 65 6e 74 20 71 |from the| event q|
|00000890| 75 65 75 65 0d 09 49 6e | 69 74 57 69 6e 64 6f 77 |ueue..In|itWindow|
|000008a0| 73 20 28 29 3b 09 09 09 | 09 2f 2f 20 20 69 6e 69 |s ();...|.// ini|
|000008b0| 74 69 61 6c 69 7a 65 73 | 20 74 68 65 20 57 69 6e |tializes| the Win|
|000008c0| 64 6f 77 20 4d 61 6e 61 | 67 65 72 0d 09 49 6e 69 |dow Mana|ger..Ini|
|000008d0| 74 4d 65 6e 75 73 20 28 | 29 3b 09 09 09 09 09 2f |tMenus (|);...../|
|000008e0| 2f 20 20 69 6e 69 74 69 | 61 6c 69 7a 65 73 20 74 |/ initi|alizes t|
|000008f0| 68 65 20 4d 65 6e 75 20 | 4d 61 6e 61 67 65 72 0d |he Menu |Manager.|
|00000900| 09 54 45 49 6e 69 74 20 | 28 29 3b 09 09 09 09 09 |.TEInit |();.....|
|00000910| 09 2f 2f 20 20 69 6e 69 | 74 69 61 6c 69 7a 65 73 |.// ini|tializes|
|00000920| 20 54 65 78 74 45 64 69 | 74 0d 09 49 6e 69 74 44 | TextEdi|t..InitD|
|00000930| 69 61 6c 6f 67 73 20 28 | 4e 55 4c 4c 29 3b 09 09 |ialogs (|NULL);..|
|00000940| 09 2f 2f 20 20 69 6e 69 | 74 69 61 6c 69 7a 65 73 |.// ini|tializes|
|00000950| 20 74 68 65 20 44 69 61 | 6c 6f 67 20 4d 61 6e 61 | the Dia|log Mana|
|00000960| 67 65 72 2e 0d 09 49 6e | 69 74 43 75 72 73 6f 72 |ger...In|itCursor|
|00000970| 20 28 29 3b 09 09 09 09 | 09 2f 2f 20 20 73 65 74 | ();....|.// set|
|00000980| 73 20 74 68 65 20 63 75 | 72 73 6f 72 20 74 6f 20 |s the cu|rsor to |
|00000990| 61 6e 20 61 72 72 6f 77 | 0d 09 4d 61 78 41 70 70 |an arrow|..MaxApp|
|000009a0| 6c 5a 6f 6e 65 20 28 29 | 3b 09 09 09 09 2f 2f 20 |lZone ()|;....// |
|000009b0| 20 65 78 70 61 6e 64 73 | 20 74 68 65 20 61 70 70 | expands| the app|
|000009c0| 6c 69 63 61 74 69 6f 6e | 20 68 65 61 70 20 7a 6f |lication| heap zo|
|000009d0| 6e 65 20 74 6f 20 69 74 | 73 20 6c 69 6d 69 74 0d |ne to it|s limit.|
|000009e0| 7d 0d 0d 0d 76 6f 69 64 | 20 4d 65 6e 75 49 6e 69 |}...void| MenuIni|
|000009f0| 74 20 28 76 6f 69 64 29 | 0d 0d 2f 2f 09 54 68 69 |t (void)|..//.Thi|
|00000a00| 73 20 66 75 6e 63 74 69 | 6f 6e 20 72 65 61 64 73 |s functi|on reads|
|00000a10| 20 69 6e 20 74 68 65 20 | 6d 65 6e 75 20 62 61 72 | in the |menu bar|
|00000a20| 20 66 72 6f 6d 20 74 68 | 65 20 72 65 73 6f 75 72 | from th|e resour|
|00000a30| 63 65 20 66 69 6c 65 2c | 20 61 64 64 73 20 74 68 |ce file,| adds th|
|00000a40| 65 20 41 70 70 6c 65 20 | 6d 65 6e 75 20 69 74 65 |e Apple |menu ite|
|00000a50| 6d 73 2c 20 74 68 65 6e | 20 64 69 73 70 6c 61 79 |ms, then| display|
|00000a60| 73 20 69 74 2e 0d 0d 7b | 0d 09 2f 2f 09 52 65 61 |s it...{|..//.Rea|
|00000a70| 64 20 69 6e 20 74 68 65 | 20 6d 65 6e 75 20 62 61 |d in the| menu ba|
|00000a80| 72 20 66 72 6f 6d 20 74 | 68 65 20 72 65 73 6f 75 |r from t|he resou|
|00000a90| 72 63 65 20 66 69 6c 65 | 20 61 6e 64 20 6d 61 6b |rce file| and mak|
|00000aa0| 65 20 69 74 20 74 68 65 | 20 63 75 72 72 65 6e 74 |e it the| current|
|00000ab0| 20 6d 65 6e 75 2e 20 20 | 41 64 64 20 74 68 65 20 | menu. |Add the |
|00000ac0| 64 65 73 6b 20 61 63 63 | 65 73 73 6f 72 69 65 73 |desk acc|essories|
|00000ad0| 0d 09 2f 2f 09 74 6f 20 | 74 68 65 20 61 70 70 6c |..//.to |the appl|
|00000ae0| 65 20 6d 65 6e 75 2c 20 | 74 68 65 6e 20 64 72 61 |e menu, |then dra|
|00000af0| 77 20 74 68 65 20 6d 65 | 6e 75 20 62 61 72 2e 0d |w the me|nu bar..|
|00000b00| 09 0d 09 53 65 74 4d 65 | 6e 75 42 61 72 20 28 47 |...SetMe|nuBar (G|
|00000b10| 65 74 4e 65 77 4d 42 61 | 72 20 28 6b 4d 65 6e 75 |etNewMBa|r (kMenu|
|00000b20| 42 61 72 49 44 29 29 3b | 0d 09 41 64 64 52 65 73 |BarID));|..AddRes|
|00000b30| 4d 65 6e 75 20 28 47 65 | 74 4d 48 61 6e 64 6c 65 |Menu (Ge|tMHandle|
|00000b40| 20 28 6b 41 70 70 6c 65 | 4d 65 6e 75 49 44 29 2c | (kApple|MenuID),|
|00000b50| 20 27 44 52 56 52 27 29 | 3b 0d 09 44 72 61 77 4d | 'DRVR')|;..DrawM|
|00000b60| 65 6e 75 42 61 72 20 28 | 29 3b 0d 7d 0d 0d 0d 76 |enuBar (|);.}...v|
|00000b70| 6f 69 64 20 44 72 61 77 | 57 69 6e 64 6f 77 20 28 |oid Draw|Window (|
|00000b80| 76 6f 69 64 29 0d 0d 2f | 2f 09 54 68 69 73 20 66 |void)../|/.This f|
|00000b90| 75 6e 63 74 69 6f 6e 20 | 6c 6f 61 64 73 20 74 68 |unction |loads th|
|00000ba0| 65 20 70 69 63 74 75 72 | 65 20 61 6e 64 20 77 69 |e pictur|e and wi|
|00000bb0| 6e 64 6f 77 20 66 72 6f | 6d 20 74 68 65 20 72 65 |ndow fro|m the re|
|00000bc0| 73 6f 75 72 63 65 20 66 | 69 6c 65 2c 20 74 68 65 |source f|ile, the|
|00000bd0| 6e 20 64 72 61 77 73 20 | 74 68 65 20 77 69 6e 64 |n draws |the wind|
|00000be0| 6f 77 2e 20 20 54 68 65 | 0d 2f 2f 09 70 69 63 74 |ow. The|.//.pict|
|00000bf0| 75 72 65 20 77 69 6c 6c | 20 62 65 20 64 72 61 77 |ure will| be draw|
|00000c00| 6e 20 6c 61 74 65 72 20 | 69 6e 20 72 65 73 70 6f |n later |in respo|
|00000c10| 6e 73 65 20 74 6f 20 74 | 68 65 20 69 6e 69 74 69 |nse to t|he initi|
|00000c20| 61 6c 20 75 70 64 61 74 | 65 20 65 76 65 6e 74 2e |al updat|e event.|
|00000c30| 0d 0d 7b 0d 09 2f 2f 09 | 52 65 61 64 20 69 6e 20 |..{..//.|Read in |
|00000c40| 74 68 65 20 70 69 63 74 | 75 72 65 20 61 6e 64 20 |the pict|ure and |
|00000c50| 6d 6f 76 65 20 69 74 73 | 20 66 72 61 6d 65 20 73 |move its| frame s|
|00000c60| 6f 20 74 68 61 74 20 74 | 68 65 20 74 6f 70 2d 6c |o that t|he top-l|
|00000c70| 65 66 74 20 63 6f 72 6e | 65 72 20 69 73 20 28 30 |eft corn|er is (0|
|00000c80| 2c 30 29 2e 20 20 54 68 | 69 73 20 6d 61 6b 65 73 |,0). Th|is makes|
|00000c90| 20 69 74 20 65 61 73 69 | 65 72 0d 09 2f 2f 09 74 | it easi|er..//.t|
|00000ca0| 6f 20 64 65 74 65 72 6d | 69 6e 65 20 74 68 65 20 |o determ|ine the |
|00000cb0| 70 69 63 74 75 72 65 27 | 73 20 68 65 69 67 68 74 |picture'|s height|
|00000cc0| 20 61 6e 64 20 77 69 64 | 74 68 2e 0d 09 0d 09 67 | and wid|th.....g|
|00000cd0| 50 69 63 74 75 72 65 20 | 3d 20 47 65 74 50 69 63 |Picture |= GetPic|
|00000ce0| 74 75 72 65 20 28 6b 50 | 69 63 74 75 72 65 49 44 |ture (kP|ictureID|
|00000cf0| 29 3b 0d 09 4f 66 66 73 | 65 74 52 65 63 74 20 28 |);..Offs|etRect (|
|00000d00| 26 28 2a 2a 67 50 69 63 | 74 75 72 65 29 2e 70 69 |&(**gPic|ture).pi|
|00000d10| 63 46 72 61 6d 65 2c 20 | 2d 28 2a 2a 67 50 69 63 |cFrame, |-(**gPic|
|00000d20| 74 75 72 65 29 2e 70 69 | 63 46 72 61 6d 65 2e 6c |ture).pi|cFrame.l|
|00000d30| 65 66 74 2c 20 2d 28 2a | 2a 67 50 69 63 74 75 72 |eft, -(*|*gPictur|
|00000d40| 65 29 2e 70 69 63 46 72 | 61 6d 65 2e 74 6f 70 29 |e).picFr|ame.top)|
|00000d50| 3b 0d 09 0d 09 2f 2f 09 | 52 65 61 64 20 69 6e 20 |;....//.|Read in |
|00000d60| 74 68 65 20 77 69 6e 64 | 6f 77 20 74 65 6d 70 6c |the wind|ow templ|
|00000d70| 61 74 65 2c 20 73 69 7a | 65 20 74 68 65 20 77 69 |ate, siz|e the wi|
|00000d80| 6e 64 6f 77 20 74 6f 20 | 74 68 65 20 73 69 7a 65 |ndow to |the size|
|00000d90| 20 6f 66 20 74 68 65 20 | 70 69 63 74 75 72 65 2c | of the |picture,|
|00000da0| 20 73 68 6f 77 20 74 68 | 65 20 77 69 6e 64 6f 77 | show th|e window|
|00000db0| 2c 0d 09 2f 2f 09 74 68 | 65 6e 20 6d 61 6b 65 20 |,..//.th|en make |
|00000dc0| 69 74 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 67 |it the c|urrent g|
|00000dd0| 72 61 66 50 6f 72 74 2e | 0d 09 0d 09 67 57 69 6e |rafPort.|....gWin|
|00000de0| 64 6f 77 20 3d 20 47 65 | 74 4e 65 77 43 57 69 6e |dow = Ge|tNewCWin|
|00000df0| 64 6f 77 20 28 6b 57 69 | 6e 64 6f 77 49 44 2c 20 |dow (kWi|ndowID, |
|00000e00| 4e 55 4c 4c 2c 20 28 57 | 69 6e 64 6f 77 50 74 72 |NULL, (W|indowPtr|
|00000e10| 29 20 2d 31 29 3b 0d 09 | 53 69 7a 65 57 69 6e 64 |) -1);..|SizeWind|
|00000e20| 6f 77 20 28 67 57 69 6e | 64 6f 77 2c 20 28 2a 2a |ow (gWin|dow, (**|
|00000e30| 67 50 69 63 74 75 72 65 | 29 2e 70 69 63 46 72 61 |gPicture|).picFra|
|00000e40| 6d 65 2e 72 69 67 68 74 | 2c 20 28 2a 2a 67 50 69 |me.right|, (**gPi|
|00000e50| 63 74 75 72 65 29 2e 70 | 69 63 46 72 61 6d 65 2e |cture).p|icFrame.|
|00000e60| 62 6f 74 74 6f 6d 2c 20 | 54 52 55 45 29 3b 0d 09 |bottom, |TRUE);..|
|00000e70| 53 68 6f 77 57 69 6e 64 | 6f 77 20 28 67 57 69 6e |ShowWind|ow (gWin|
|00000e80| 64 6f 77 29 3b 0d 09 53 | 65 74 50 6f 72 74 20 28 |dow);..S|etPort (|
|00000e90| 67 57 69 6e 64 6f 77 29 | 3b 0d 7d 0d 0d 0d 76 6f |gWindow)|;.}...vo|
|00000ea0| 69 64 20 55 70 64 61 74 | 65 57 69 6e 64 6f 77 20 |id Updat|eWindow |
|00000eb0| 28 76 6f 69 64 29 0d 0d | 2f 2f 09 54 68 69 73 20 |(void)..|//.This |
|00000ec0| 66 75 6e 63 74 69 6f 6e | 20 69 73 20 63 61 6c 6c |function| is call|
|00000ed0| 65 64 20 69 6e 20 72 65 | 73 70 6f 6e 73 65 20 74 |ed in re|sponse t|
|00000ee0| 6f 20 61 6e 20 75 70 64 | 61 74 65 20 65 76 65 6e |o an upd|ate even|
|00000ef0| 74 2e 20 20 49 74 20 73 | 69 6d 70 6c 79 20 64 72 |t. It s|imply dr|
|00000f00| 61 77 73 20 74 68 65 20 | 70 69 63 74 75 72 65 2e |aws the |picture.|
|00000f10| 20 20 22 42 65 67 69 6e | 55 70 64 61 74 65 28 29 | "Begin|Update()|
|00000f20| 22 0d 2f 2f 09 61 6e 64 | 20 22 45 6e 64 55 70 64 |".//.and| "EndUpd|
|00000f30| 61 74 65 28 29 22 20 6d | 75 73 74 20 61 6c 77 61 |ate()" m|ust alwa|
|00000f40| 79 73 20 62 65 20 63 61 | 6c 6c 65 64 20 77 68 65 |ys be ca|lled whe|
|00000f50| 6e 20 72 65 73 70 6f 6e | 64 69 6e 67 20 74 6f 20 |n respon|ding to |
|00000f60| 61 6e 20 75 70 64 61 74 | 65 20 65 76 65 6e 74 2e |an updat|e event.|
|00000f70| 20 20 54 68 65 79 20 68 | 61 6e 64 6c 65 20 74 68 | They h|andle th|
|00000f80| 65 20 75 70 64 61 74 65 | 0d 2f 2f 09 72 65 67 69 |e update|.//.regi|
|00000f90| 6f 6e 20 73 6f 20 74 68 | 61 74 20 6f 6e 6c 79 20 |on so th|at only |
|00000fa0| 74 68 65 20 70 61 72 74 | 20 6f 66 20 74 68 65 20 |the part| of the |
|00000fb0| 77 69 6e 64 6f 77 20 74 | 68 61 74 20 63 68 61 6e |window t|hat chan|
|00000fc0| 67 65 64 20 77 69 6c 6c | 20 62 65 20 72 65 64 72 |ged will| be redr|
|00000fd0| 61 77 6e 2e 0d 0d 7b 0d | 09 42 65 67 69 6e 55 70 |awn...{.|.BeginUp|
|00000fe0| 64 61 74 65 20 28 67 57 | 69 6e 64 6f 77 29 3b 0d |date (gW|indow);.|
|00000ff0| 09 44 72 61 77 50 69 63 | 74 75 72 65 20 28 67 50 |.DrawPic|ture (gP|
|00001000| 69 63 74 75 72 65 2c 20 | 26 28 67 57 69 6e 64 6f |icture, |&(gWindo|
|00001010| 77 2d 3e 70 6f 72 74 52 | 65 63 74 29 29 3b 0d 09 |w->portR|ect));..|
|00001020| 45 6e 64 55 70 64 61 74 | 65 20 28 67 57 69 6e 64 |EndUpdat|e (gWind|
|00001030| 6f 77 29 3b 0d 7d 0d 0d | 0d 76 6f 69 64 20 4d 79 |ow);.}..|.void My|
|00001040| 44 72 61 67 57 69 6e 64 | 6f 77 20 28 29 0d 0d 2f |DragWind|ow ()../|
|00001050| 2f 09 54 68 69 73 20 69 | 73 20 74 68 65 20 63 75 |/.This i|s the cu|
|00001060| 73 74 6f 6d 20 64 72 61 | 67 20 72 6f 75 74 69 6e |stom dra|g routin|
|00001070| 65 20 74 6f 20 64 72 61 | 67 20 74 68 65 20 77 69 |e to dra|g the wi|
|00001080| 6e 64 6f 77 20 69 6e 20 | 22 72 65 61 6c 2d 74 69 |ndow in |"real-ti|
|00001090| 6d 65 22 2e 0d 0d 7b 0d | 09 50 6f 69 6e 74 09 69 |me"...{.|.Point.i|
|000010a0| 6e 69 74 69 61 6c 50 6f | 69 6e 74 2c 09 09 09 2f |nitialPo|int,.../|
|000010b0| 2f 20 20 74 68 65 20 69 | 6e 69 74 69 61 6c 20 70 |/ the i|nitial p|
|000010c0| 6f 69 6e 74 20 77 68 65 | 72 65 20 74 68 65 20 6d |oint whe|re the m|
|000010d0| 6f 75 73 65 20 77 61 73 | 20 63 6c 69 63 6b 65 64 |ouse was| clicked|
|000010e0| 0d 09 09 09 63 75 72 72 | 65 6e 74 50 6f 69 6e 74 |....curr|entPoint|
|000010f0| 2c 09 09 09 2f 2f 20 20 | 74 68 65 20 63 75 72 72 |,...// |the curr|
|00001100| 65 6e 74 20 6d 6f 75 73 | 65 20 70 6f 73 69 74 69 |ent mous|e positi|
|00001110| 6f 6e 0d 09 09 09 6c 61 | 73 74 50 6f 69 6e 74 3b |on....la|stPoint;|
|00001120| 09 09 09 09 2f 2f 20 20 | 74 68 65 20 70 72 65 76 |....// |the prev|
|00001130| 69 6f 75 73 20 6d 6f 75 | 73 65 20 70 6f 73 69 74 |ious mou|se posit|
|00001140| 69 6f 6e 0d 09 52 65 63 | 74 09 09 64 72 61 67 52 |ion..Rec|t..dragR|
|00001150| 65 63 74 3b 09 09 09 09 | 2f 2f 20 20 74 68 65 20 |ect;....|// the |
|00001160| 61 72 65 61 20 77 68 65 | 72 65 20 74 68 65 20 77 |area whe|re the w|
|00001170| 69 6e 64 6f 77 20 63 61 | 6e 20 62 65 20 64 72 61 |indow ca|n be dra|
|00001180| 67 67 65 64 0d 09 0d 09 | 2f 2f 09 43 61 6c 63 75 |gged....|//.Calcu|
|00001190| 6c 61 74 65 20 74 68 65 | 20 61 72 65 61 20 77 68 |late the| area wh|
|000011a0| 65 72 65 20 74 68 65 20 | 77 69 6e 64 6f 77 20 63 |ere the |window c|
|000011b0| 61 6e 20 62 65 20 64 72 | 61 67 67 65 64 2e 20 20 |an be dr|agged. |
|000011c0| 54 68 69 73 20 69 73 20 | 34 20 70 69 78 65 6c 73 |This is |4 pixels|
|000011d0| 20 66 72 6f 6d 20 74 68 | 65 20 65 64 67 65 20 6f | from th|e edge o|
|000011e0| 66 20 74 68 65 0d 09 2f | 2f 09 73 63 72 65 65 6e |f the../|/.screen|
|000011f0| 2e 20 20 54 68 65 20 68 | 65 69 67 68 74 20 6f 66 |. The h|eight of|
|00001200| 20 74 68 65 20 6d 65 6e | 75 20 62 61 72 20 69 73 | the men|u bar is|
|00001210| 20 73 75 62 74 72 61 63 | 74 65 64 20 66 72 6f 6d | subtrac|ted from|
|00001220| 20 74 68 65 20 74 6f 70 | 20 65 64 67 65 20 74 6f | the top| edge to|
|00001230| 20 70 72 65 76 65 6e 74 | 20 74 68 65 20 77 69 6e | prevent| the win|
|00001240| 64 6f 77 0d 09 2f 2f 09 | 66 72 6f 6d 20 62 65 69 |dow..//.|from bei|
|00001250| 6e 67 20 6d 6f 76 65 64 | 20 75 6e 64 65 72 20 69 |ng moved| under i|
|00001260| 74 2e 0d 09 0d 09 64 72 | 61 67 52 65 63 74 20 3d |t.....dr|agRect =|
|00001270| 20 71 64 2e 73 63 72 65 | 65 6e 42 69 74 73 2e 62 | qd.scre|enBits.b|
|00001280| 6f 75 6e 64 73 3b 0d 09 | 49 6e 73 65 74 52 65 63 |ounds;..|InsetRec|
|00001290| 74 20 28 26 64 72 61 67 | 52 65 63 74 2c 20 34 2c |t (&drag|Rect, 4,|
|000012a0| 20 34 29 3b 0d 09 64 72 | 61 67 52 65 63 74 2e 74 | 4);..dr|agRect.t|
|000012b0| 6f 70 20 2b 3d 20 47 65 | 74 4d 42 61 72 48 65 69 |op += Ge|tMBarHei|
|000012c0| 67 68 74 20 28 29 3b 0d | 0d 09 2f 2f 09 43 61 6c |ght ();.|..//.Cal|
|000012d0| 63 75 6c 61 74 65 20 74 | 68 65 20 70 6f 69 6e 74 |culate t|he point|
|000012e0| 20 77 68 65 72 65 20 74 | 68 65 20 6d 6f 75 73 65 | where t|he mouse|
|000012f0| 20 77 61 73 20 69 6e 69 | 74 69 61 6c 6c 79 20 63 | was ini|tially c|
|00001300| 6c 69 63 6b 65 64 20 28 | 69 6e 20 74 68 65 20 77 |licked (|in the w|
|00001310| 69 6e 64 6f 77 27 73 20 | 63 6f 6f 72 64 69 6e 61 |indow's |coordina|
|00001320| 74 65 20 73 79 73 74 65 | 6d 29 2e 0d 09 0d 09 69 |te syste|m).....i|
|00001330| 6e 69 74 69 61 6c 50 6f | 69 6e 74 20 3d 20 67 54 |nitialPo|int = gT|
|00001340| 68 65 45 76 65 6e 74 2e | 77 68 65 72 65 3b 0d 09 |heEvent.|where;..|
|00001350| 47 6c 6f 62 61 6c 54 6f | 4c 6f 63 61 6c 20 28 26 |GlobalTo|Local (&|
|00001360| 69 6e 69 74 69 61 6c 50 | 6f 69 6e 74 29 3b 0d 0d |initialP|oint);..|
|00001370| 09 2f 2f 09 4c 6f 6f 70 | 20 77 68 69 6c 65 20 74 |.//.Loop| while t|
|00001380| 68 65 20 6d 6f 75 73 65 | 20 62 75 74 74 6f 6e 20 |he mouse| button |
|00001390| 69 73 20 68 65 6c 64 20 | 64 6f 77 6e 2e 0d 09 0d |is held |down....|
|000013a0| 09 77 68 69 6c 65 20 28 | 53 74 69 6c 6c 44 6f 77 |.while (|StillDow|
|000013b0| 6e 20 28 29 29 0d 09 7b | 0d 09 09 2f 2f 09 47 65 |n ())..{|...//.Ge|
|000013c0| 74 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 6d 6f |t the cu|rrent mo|
|000013d0| 75 73 65 20 70 6f 73 69 | 74 69 6f 6e 2c 20 69 6e |use posi|tion, in|
|000013e0| 20 67 6c 6f 62 61 6c 20 | 63 6f 6f 72 64 69 6e 61 | global |coordina|
|000013f0| 74 65 73 2e 0d 09 09 0d | 09 09 47 65 74 4d 6f 75 |tes.....|..GetMou|
|00001400| 73 65 20 28 26 63 75 72 | 72 65 6e 74 50 6f 69 6e |se (&cur|rentPoin|
|00001410| 74 29 3b 0d 09 09 4c 6f | 63 61 6c 54 6f 47 6c 6f |t);...Lo|calToGlo|
|00001420| 62 61 6c 20 28 26 63 75 | 72 72 65 6e 74 50 6f 69 |bal (&cu|rrentPoi|
|00001430| 6e 74 29 3b 0d 09 09 0d | 09 09 2f 2f 09 49 66 20 |nt);....|..//.If |
|00001440| 74 68 65 20 70 6f 69 6e | 74 20 69 73 20 69 6e 73 |the poin|t is ins|
|00001450| 69 64 65 20 74 68 65 20 | 64 72 61 67 20 72 65 63 |ide the |drag rec|
|00001460| 74 61 6e 67 6c 65 2c 20 | 74 68 65 6e 20 74 68 65 |tangle, |then the|
|00001470| 20 77 69 6e 64 6f 77 20 | 63 61 6e 20 62 65 20 6d | window |can be m|
|00001480| 6f 76 65 64 2e 0d 09 09 | 0d 09 09 69 66 20 28 50 |oved....|...if (P|
|00001490| 74 49 6e 52 65 63 74 20 | 28 63 75 72 72 65 6e 74 |tInRect |(current|
|000014a0| 50 6f 69 6e 74 2c 20 26 | 64 72 61 67 52 65 63 74 |Point, &|dragRect|
|000014b0| 29 29 0d 09 09 7b 0d 09 | 09 09 2f 2f 09 53 75 62 |))...{..|..//.Sub|
|000014c0| 74 72 61 63 74 20 74 68 | 65 20 69 6e 69 74 69 61 |tract th|e initia|
|000014d0| 6c 20 70 6f 69 6e 74 20 | 66 72 6f 6d 20 74 68 65 |l point |from the|
|000014e0| 20 63 75 72 72 65 6e 74 | 20 70 6f 69 6e 74 2e 20 | current| point. |
|000014f0| 20 54 68 69 73 20 77 69 | 6c 6c 20 63 61 75 73 65 | This wi|ll cause|
|00001500| 20 74 68 65 20 77 69 6e | 64 6f 77 20 74 6f 20 62 | the win|dow to b|
|00001510| 65 0d 09 09 09 2f 2f 09 | 6d 6f 76 65 64 20 77 69 |e....//.|moved wi|
|00001520| 74 68 20 74 68 65 20 63 | 75 72 73 6f 72 2c 20 72 |th the c|ursor, r|
|00001530| 65 67 61 72 64 6c 65 73 | 73 20 6f 66 20 77 68 65 |egardles|s of whe|
|00001540| 72 65 20 69 6e 20 74 68 | 65 20 77 69 6e 64 6f 77 |re in th|e window|
|00001550| 20 69 74 20 77 61 73 20 | 63 6c 69 63 6b 65 64 2e | it was |clicked.|
|00001560| 0d 09 09 09 0d 09 09 09 | 53 75 62 50 74 20 28 69 |........|SubPt (i|
|00001570| 6e 69 74 69 61 6c 50 6f | 69 6e 74 2c 20 26 63 75 |nitialPo|int, &cu|
|00001580| 72 72 65 6e 74 50 6f 69 | 6e 74 29 3b 0d 09 09 09 |rrentPoi|nt);....|
|00001590| 0d 09 09 09 2f 2f 09 49 | 66 20 74 68 65 20 63 75 |....//.I|f the cu|
|000015a0| 72 72 65 6e 74 20 70 6f | 69 6e 74 20 69 73 20 64 |rrent po|int is d|
|000015b0| 69 66 66 65 72 65 6e 74 | 20 66 72 6f 6d 20 74 68 |ifferent| from th|
|000015c0| 65 20 6c 61 73 74 20 70 | 6f 69 6e 74 2c 20 6d 6f |e last p|oint, mo|
|000015d0| 76 65 20 74 68 65 20 77 | 69 6e 64 6f 77 20 61 6e |ve the w|indow an|
|000015e0| 64 20 72 65 73 65 74 20 | 74 68 65 0d 09 09 09 2f |d reset |the..../|
|000015f0| 2f 09 6c 61 73 74 20 70 | 6f 69 6e 74 2e 20 20 54 |/.last p|oint. T|
|00001600| 68 69 73 20 63 68 65 63 | 6b 20 69 73 20 70 65 72 |his chec|k is per|
|00001610| 66 6f 72 6d 65 64 20 73 | 6f 20 74 68 61 74 20 22 |formed s|o that "|
|00001620| 4d 6f 76 65 57 69 6e 64 | 6f 77 28 29 22 20 69 73 |MoveWind|ow()" is|
|00001630| 20 6e 6f 74 20 63 61 6c | 6c 65 64 20 77 68 65 6e | not cal|led when|
|00001640| 20 74 68 65 0d 09 09 09 | 2f 2f 09 6d 6f 75 73 65 | the....|//.mouse|
|00001650| 20 69 73 20 6e 6f 74 20 | 6d 6f 76 69 6e 67 20 28 | is not |moving (|
|00001660| 77 68 69 63 68 20 77 6f | 75 6c 64 20 63 61 75 73 |which wo|uld caus|
|00001670| 65 20 74 68 65 20 63 75 | 72 73 6f 72 20 74 6f 20 |e the cu|rsor to |
|00001680| 62 6c 69 6e 6b 20 61 6e | 6e 6f 79 69 6e 67 6c 79 |blink an|noyingly|
|00001690| 29 2e 0d 09 09 09 0d 09 | 09 09 69 66 20 28 21 45 |).......|..if (!E|
|000016a0| 71 75 61 6c 50 74 20 28 | 63 75 72 72 65 6e 74 50 |qualPt (|currentP|
|000016b0| 6f 69 6e 74 2c 20 6c 61 | 73 74 50 6f 69 6e 74 29 |oint, la|stPoint)|
|000016c0| 29 0d 09 09 09 7b 0d 09 | 09 09 09 4d 6f 76 65 57 |)....{..|...MoveW|
|000016d0| 69 6e 64 6f 77 20 28 67 | 57 69 6e 64 6f 77 2c 20 |indow (g|Window, |
|000016e0| 63 75 72 72 65 6e 74 50 | 6f 69 6e 74 2e 68 2c 20 |currentP|oint.h, |
|000016f0| 63 75 72 72 65 6e 74 50 | 6f 69 6e 74 2e 76 2c 20 |currentP|oint.v, |
|00001700| 46 41 4c 53 45 29 3b 0d | 09 09 09 09 6c 61 73 74 |FALSE);.|....last|
|00001710| 50 6f 69 6e 74 20 3d 20 | 63 75 72 72 65 6e 74 50 |Point = |currentP|
|00001720| 6f 69 6e 74 3b 0d 09 09 | 09 7d 0d 09 09 7d 0d 09 |oint;...|.}...}..|
|00001730| 09 0d 09 09 2f 2f 09 43 | 61 6c 6c 20 22 57 61 69 |....//.C|all "Wai|
|00001740| 74 4e 65 78 74 45 76 65 | 6e 74 28 29 22 20 74 6f |tNextEve|nt()" to|
|00001750| 20 67 69 76 65 20 62 61 | 63 6b 67 72 6f 75 6e 64 | give ba|ckground|
|00001760| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 73 20 61 20 | applica|tions a |
|00001770| 63 68 61 6e 63 65 20 74 | 6f 20 75 70 64 61 74 65 |chance t|o update|
|00001780| 20 74 68 65 69 72 20 77 | 69 6e 64 6f 77 73 2e 0d | their w|indows..|
|00001790| 09 09 0d 09 09 57 61 69 | 74 4e 65 78 74 45 76 65 |.....Wai|tNextEve|
|000017a0| 6e 74 20 28 65 76 65 72 | 79 45 76 65 6e 74 2c 20 |nt (ever|yEvent, |
|000017b0| 26 67 54 68 65 45 76 65 | 6e 74 2c 20 6b 4d 61 78 |&gTheEve|nt, kMax|
|000017c0| 57 61 69 74 2c 20 4e 55 | 4c 4c 29 3b 0d 09 09 0d |Wait, NU|LL);....|
|000017d0| 09 09 2f 2f 09 49 66 20 | 61 6e 20 75 70 64 61 74 |..//.If |an updat|
|000017e0| 65 20 65 76 65 6e 74 20 | 69 73 20 72 65 63 65 69 |e event |is recei|
|000017f0| 76 65 64 2c 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |ved, the| window |
|00001800| 6e 65 65 64 73 20 74 6f | 20 62 65 20 72 65 64 72 |needs to| be redr|
|00001810| 61 77 6e 2e 0d 09 09 0d | 09 09 69 66 20 28 67 54 |awn.....|..if (gT|
|00001820| 68 65 45 76 65 6e 74 2e | 77 68 61 74 20 3d 3d 20 |heEvent.|what == |
|00001830| 75 70 64 61 74 65 45 76 | 74 29 0d 09 09 09 55 70 |updateEv|t)....Up|
|00001840| 64 61 74 65 57 69 6e 64 | 6f 77 20 28 29 3b 0d 09 |dateWind|ow ();..|
|00001850| 7d 0d 7d 0d 0d 0d 76 6f | 69 64 20 48 61 6e 64 6c |}.}...vo|id Handl|
|00001860| 65 41 70 70 6c 65 43 68 | 6f 69 63 65 20 28 73 68 |eAppleCh|oice (sh|
|00001870| 6f 72 74 20 74 68 65 49 | 74 65 6d 29 0d 0d 2f 2f |ort theI|tem)..//|
|00001880| 09 48 61 6e 64 6c 65 73 | 20 61 20 63 68 6f 69 63 |.Handles| a choic|
|00001890| 65 20 66 72 6f 6d 20 74 | 68 65 20 41 70 70 6c 65 |e from t|he Apple|
|000018a0| 20 6d 65 6e 75 2c 20 77 | 68 65 72 65 20 22 74 68 | menu, w|here "th|
|000018b0| 65 49 74 65 6d 22 20 69 | 73 20 74 68 65 20 6d 65 |eItem" i|s the me|
|000018c0| 6e 75 20 69 74 65 6d 20 | 6e 75 6d 62 65 72 2e 0d |nu item |number..|
|000018d0| 0d 7b 0d 09 53 74 72 32 | 35 35 20 64 65 73 6b 41 |.{..Str2|55 deskA|
|000018e0| 63 63 65 73 73 6f 72 79 | 3b 09 09 2f 2f 20 20 6e |ccessory|;..// n|
|000018f0| 61 6d 65 20 6f 66 20 64 | 65 73 6b 20 61 63 63 65 |ame of d|esk acce|
|00001900| 73 73 6f 72 79 0d 0d 09 | 2f 2f 09 49 66 20 74 68 |ssory...|//.If th|
|00001910| 65 20 22 41 62 6f 75 74 | 20 44 72 61 67 44 65 6d |e "About| DragDem|
|00001920| 6f c9 22 20 69 74 65 6d | 20 77 61 73 20 63 68 6f |o." item| was cho|
|00001930| 73 65 6e 2c 20 64 69 73 | 70 6c 61 79 20 74 68 65 |sen, dis|play the|
|00001940| 20 61 6c 65 72 74 20 62 | 6f 78 2e 0d 09 0d 09 69 | alert b|ox.....i|
|00001950| 66 20 28 74 68 65 49 74 | 65 6d 20 3d 3d 20 31 29 |f (theIt|em == 1)|
|00001960| 0d 09 09 41 6c 65 72 74 | 20 28 6b 41 62 6f 75 74 |...Alert| (kAbout|
|00001970| 49 44 2c 20 4e 55 4c 4c | 29 3b 0d 0d 09 2f 2f 09 |ID, NULL|);...//.|
|00001980| 4f 74 68 65 72 77 69 73 | 65 2c 20 67 65 74 20 74 |Otherwis|e, get t|
|00001990| 68 65 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 64 |he name |of the d|
|000019a0| 65 73 6b 20 61 63 63 65 | 73 73 6f 72 79 20 63 68 |esk acce|ssory ch|
|000019b0| 6f 73 65 6e 20 61 6e 64 | 20 6f 70 65 6e 20 69 74 |osen and| open it|
|000019c0| 2e 0d 09 0d 09 65 6c 73 | 65 0d 09 7b 0d 09 09 47 |.....els|e..{...G|
|000019d0| 65 74 49 74 65 6d 20 28 | 47 65 74 4d 48 61 6e 64 |etItem (|GetMHand|
|000019e0| 6c 65 20 28 6b 41 70 70 | 6c 65 4d 65 6e 75 49 44 |le (kApp|leMenuID|
|000019f0| 29 2c 20 74 68 65 49 74 | 65 6d 2c 20 26 64 65 73 |), theIt|em, &des|
|00001a00| 6b 41 63 63 65 73 73 6f | 72 79 29 3b 0d 09 09 4f |kAccesso|ry);...O|
|00001a10| 70 65 6e 44 65 73 6b 41 | 63 63 20 28 64 65 73 6b |penDeskA|cc (desk|
|00001a20| 41 63 63 65 73 73 6f 72 | 79 29 3b 0d 09 7d 0d 7d |Accessor|y);..}.}|
|00001a30| 0d 0d 0d 76 6f 69 64 20 | 48 61 6e 64 6c 65 4d 65 |...void |HandleMe|
|00001a40| 6e 75 43 68 6f 69 63 65 | 20 28 6c 6f 6e 67 20 6d |nuChoice| (long m|
|00001a50| 65 6e 75 43 68 6f 69 63 | 65 29 0d 0d 2f 2f 09 48 |enuChoic|e)..//.H|
|00001a60| 61 6e 64 6c 65 73 20 61 | 20 6d 65 6e 75 20 63 68 |andles a| menu ch|
|00001a70| 6f 69 63 65 2e 0d 0d 7b | 0d 09 2f 2f 09 43 68 65 |oice...{|..//.Che|
|00001a80| 63 6b 20 74 68 65 20 6d | 65 6e 75 20 49 44 2c 20 |ck the m|enu ID, |
|00001a90| 77 68 69 63 68 20 69 73 | 20 73 74 6f 72 65 64 20 |which is| stored |
|00001aa0| 69 6e 20 74 68 65 20 68 | 69 67 68 2d 6f 72 64 65 |in the h|igh-orde|
|00001ab0| 72 20 77 6f 72 64 20 6f | 66 20 22 6d 65 6e 75 43 |r word o|f "menuC|
|00001ac0| 68 6f 69 63 65 22 2e 0d | 09 0d 09 73 77 69 74 63 |hoice"..|...switc|
|00001ad0| 68 20 28 48 69 57 6f 72 | 64 20 28 6d 65 6e 75 43 |h (HiWor|d (menuC|
|00001ae0| 68 6f 69 63 65 29 29 0d | 09 7b 0d 09 09 2f 2f 09 |hoice)).|.{...//.|
|00001af0| 49 66 20 74 68 65 20 41 | 70 70 6c 65 20 6d 65 6e |If the A|pple men|
|00001b00| 75 20 77 61 73 20 73 65 | 6c 65 63 74 65 64 2c 20 |u was se|lected, |
|00001b10| 63 61 6c 6c 20 22 48 61 | 6e 64 6c 65 41 70 70 6c |call "Ha|ndleAppl|
|00001b20| 65 43 68 6f 69 63 65 22 | 20 77 69 74 68 20 74 68 |eChoice"| with th|
|00001b30| 65 20 6d 65 6e 75 20 69 | 74 65 6d 20 6e 75 6d 62 |e menu i|tem numb|
|00001b40| 65 72 2c 0d 09 09 2f 2f | 09 77 68 69 63 68 20 69 |er,...//|.which i|
|00001b50| 73 20 73 74 6f 72 65 64 | 20 69 6e 20 74 68 65 20 |s stored| in the |
|00001b60| 6c 6f 77 2d 6f 72 64 65 | 72 20 77 6f 72 64 20 6f |low-orde|r word o|
|00001b70| 66 20 22 6d 65 6e 75 43 | 68 6f 69 63 65 22 2e 0d |f "menuC|hoice"..|
|00001b80| 09 09 0d 09 09 63 61 73 | 65 20 6b 41 70 70 6c 65 |.....cas|e kApple|
|00001b90| 4d 65 6e 75 49 44 3a 0d | 09 09 09 48 61 6e 64 6c |MenuID:.|...Handl|
|00001ba0| 65 41 70 70 6c 65 43 68 | 6f 69 63 65 20 28 4c 6f |eAppleCh|oice (Lo|
|00001bb0| 57 6f 72 64 20 28 6d 65 | 6e 75 43 68 6f 69 63 65 |Word (me|nuChoice|
|00001bc0| 29 29 3b 0d 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |));....b|reak;...|
|00001bd0| 0d 09 09 2f 2f 09 49 66 | 20 61 6e 20 69 74 65 6d |...//.If| an item|
|00001be0| 20 69 6e 20 74 68 65 20 | 66 69 6c 65 20 6d 65 6e | in the |file men|
|00001bf0| 75 20 77 61 73 20 73 65 | 6c 65 63 74 65 64 2c 20 |u was se|lected, |
|00001c00| 73 65 74 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 |set the |program |
|00001c10| 74 65 72 6d 69 6e 61 74 | 69 6f 6e 20 66 6c 61 67 |terminat|ion flag|
|00001c20| 20 28 73 69 6e 63 65 20 | 22 43 6c 6f 73 65 22 0d | (since |"Close".|
|00001c30| 09 09 2f 2f 09 61 6e 64 | 20 22 51 75 69 74 22 20 |..//.and| "Quit" |
|00001c40| 64 6f 20 74 68 65 20 73 | 61 6d 65 20 74 68 69 6e |do the s|ame thin|
|00001c50| 67 2c 20 69 74 20 64 6f | 65 73 6e 27 74 20 6d 61 |g, it do|esn't ma|
|00001c60| 74 74 65 72 20 77 68 69 | 63 68 20 6f 6e 65 20 77 |tter whi|ch one w|
|00001c70| 61 73 20 73 65 6c 65 63 | 74 65 64 29 2e 0d 09 09 |as selec|ted)....|
|00001c80| 0d 09 09 63 61 73 65 20 | 6b 46 69 6c 65 4d 65 6e |...case |kFileMen|
|00001c90| 75 49 44 3a 0d 09 09 09 | 67 44 6f 6e 65 20 3d 20 |uID:....|gDone = |
|00001ca0| 54 52 55 45 3b 0d 09 09 | 09 62 72 65 61 6b 3b 0d |TRUE;...|.break;.|
|00001cb0| 09 7d 0d 09 0d 09 2f 2f | 09 22 48 69 6c 69 74 65 |.}....//|."Hilite|
|00001cc0| 4d 65 6e 75 28 29 22 20 | 6d 75 73 74 20 62 65 20 |Menu()" |must be |
|00001cd0| 63 61 6c 6c 65 64 20 74 | 6f 20 75 6e 68 69 6c 69 |called t|o unhili|
|00001ce0| 74 65 20 74 68 65 20 6d | 65 6e 75 20 62 61 72 2e |te the m|enu bar.|
|00001cf0| 0d 09 0d 09 48 69 6c 69 | 74 65 4d 65 6e 75 20 28 |....Hili|teMenu (|
|00001d00| 30 29 3b 0d 7d 0d 0d 0d | 76 6f 69 64 20 48 61 6e |0);.}...|void Han|
|00001d10| 64 6c 65 4d 6f 75 73 65 | 44 6f 77 6e 20 28 76 6f |dleMouse|Down (vo|
|00001d20| 69 64 29 0d 0d 2f 2f 09 | 48 61 6e 64 6c 65 73 20 |id)..//.|Handles |
|00001d30| 61 20 6d 6f 75 73 65 20 | 64 6f 77 6e 20 65 76 65 |a mouse |down eve|
|00001d40| 6e 74 2e 0d 0d 7b 0d 09 | 57 69 6e 64 6f 77 50 74 |nt...{..|WindowPt|
|00001d50| 72 20 77 68 69 63 68 57 | 69 6e 64 6f 77 3b 09 09 |r whichW|indow;..|
|00001d60| 2f 2f 20 20 77 68 69 63 | 68 20 77 69 6e 64 6f 77 |// whic|h window|
|00001d70| 20 77 61 73 20 63 6c 69 | 63 6b 65 64 0d 0d 09 2f | was cli|cked.../|
|00001d80| 2f 09 44 65 74 65 72 6d | 69 6e 65 20 77 68 65 72 |/.Determ|ine wher|
|00001d90| 65 20 61 6e 64 20 69 6e | 20 77 68 69 63 68 20 77 |e and in| which w|
|00001da0| 69 6e 64 6f 77 20 74 68 | 65 20 6d 6f 75 73 65 20 |indow th|e mouse |
|00001db0| 77 61 73 20 63 6c 69 63 | 6b 65 64 2e 20 20 49 74 |was clic|ked. It|
|00001dc0| 20 69 73 20 6e 6f 74 20 | 72 65 61 6c 6c 79 20 6e | is not |really n|
|00001dd0| 65 63 65 73 73 61 72 79 | 0d 09 2f 2f 09 74 6f 20 |ecessary|..//.to |
|00001de0| 64 65 74 65 72 6d 69 6e | 65 20 77 68 69 63 68 20 |determin|e which |
|00001df0| 77 69 6e 64 6f 77 20 77 | 61 73 20 63 6c 69 63 6b |window w|as click|
|00001e00| 65 64 20 69 6e 20 74 68 | 69 73 20 70 72 6f 67 72 |ed in th|is progr|
|00001e10| 61 6d 2c 20 73 69 6e 63 | 65 20 74 68 65 72 65 20 |am, sinc|e there |
|00001e20| 69 73 20 6f 6e 6c 79 20 | 6f 6e 65 20 77 69 6e 64 |is only |one wind|
|00001e30| 6f 77 2e 0d 09 0d 09 73 | 77 69 74 63 68 20 28 46 |ow.....s|witch (F|
|00001e40| 69 6e 64 57 69 6e 64 6f | 77 20 28 67 54 68 65 45 |indWindo|w (gTheE|
|00001e50| 76 65 6e 74 2e 77 68 65 | 72 65 2c 20 26 77 68 69 |vent.whe|re, &whi|
|00001e60| 63 68 57 69 6e 64 6f 77 | 29 29 0d 09 7b 0d 09 09 |chWindow|))..{...|
|00001e70| 63 61 73 65 20 69 6e 4d | 65 6e 75 42 61 72 3a 0d |case inM|enuBar:.|
|00001e80| 09 0d 09 09 09 2f 2f 09 | 49 66 20 74 68 65 20 6d |.....//.|If the m|
|00001e90| 65 6e 75 20 62 61 72 20 | 77 61 73 20 63 6c 69 63 |enu bar |was clic|
|00001ea0| 6b 65 64 2c 20 63 61 6c | 6c 20 22 4d 65 6e 75 53 |ked, cal|l "MenuS|
|00001eb0| 65 6c 65 63 74 28 29 22 | 20 74 6f 20 64 65 74 65 |elect()"| to dete|
|00001ec0| 72 6d 69 6e 65 20 74 68 | 65 20 6d 65 6e 75 20 63 |rmine th|e menu c|
|00001ed0| 68 6f 69 63 65 0d 09 09 | 09 2f 2f 09 61 6e 64 20 |hoice...|.//.and |
|00001ee0| 70 61 73 73 20 69 74 20 | 74 6f 20 22 48 61 6e 64 |pass it |to "Hand|
|00001ef0| 6c 65 4d 65 6e 75 43 68 | 6f 69 63 65 28 29 22 2e |leMenuCh|oice()".|
|00001f00| 0d 09 09 0d 09 09 09 48 | 61 6e 64 6c 65 4d 65 6e |.......H|andleMen|
|00001f10| 75 43 68 6f 69 63 65 20 | 28 4d 65 6e 75 53 65 6c |uChoice |(MenuSel|
|00001f20| 65 63 74 20 28 67 54 68 | 65 45 76 65 6e 74 2e 77 |ect (gTh|eEvent.w|
|00001f30| 68 65 72 65 29 29 3b 0d | 09 09 09 62 72 65 61 6b |here));.|...break|
|00001f40| 3b 0d 0d 09 09 63 61 73 | 65 20 69 6e 47 6f 41 77 |;....cas|e inGoAw|
|00001f50| 61 79 3a 0d 09 09 09 0d | 09 09 09 2f 2f 09 49 66 |ay:.....|...//.If|
|00001f60| 20 74 68 65 20 67 6f 2d | 61 77 61 79 20 28 63 6c | the go-|away (cl|
|00001f70| 6f 73 65 29 20 62 6f 78 | 20 77 61 73 20 63 6c 69 |ose) box| was cli|
|00001f80| 63 6b 65 64 2c 20 63 61 | 6c 6c 20 22 54 72 61 63 |cked, ca|ll "Trac|
|00001f90| 6b 47 6f 41 77 61 79 28 | 29 22 20 74 6f 20 74 72 |kGoAway(|)" to tr|
|00001fa0| 61 63 6b 20 74 68 65 20 | 6d 6f 75 73 65 20 61 6e |ack the |mouse an|
|00001fb0| 64 0d 09 09 09 2f 2f 09 | 64 65 74 65 72 6d 69 6e |d....//.|determin|
|00001fc0| 65 20 69 66 20 69 74 20 | 77 61 73 20 72 65 6c 65 |e if it |was rele|
|00001fd0| 61 73 65 64 20 69 6e 73 | 69 64 65 20 74 68 65 20 |ased ins|ide the |
|00001fe0| 62 6f 78 2e 20 20 49 66 | 20 73 6f 2c 20 73 65 74 |box. If| so, set|
|00001ff0| 20 74 68 65 20 74 65 72 | 6d 69 6e 61 74 69 6f 6e | the ter|mination|
|00002000| 20 66 6c 61 67 2e 0d 0d | 09 09 09 69 66 20 28 54 | flag...|...if (T|
|00002010| 72 61 63 6b 47 6f 41 77 | 61 79 20 28 67 57 69 6e |rackGoAw|ay (gWin|
|00002020| 64 6f 77 2c 20 67 54 68 | 65 45 76 65 6e 74 2e 77 |dow, gTh|eEvent.w|
|00002030| 68 65 72 65 29 29 0d 09 | 09 09 09 67 44 6f 6e 65 |here))..|...gDone|
|00002040| 20 3d 20 54 52 55 45 3b | 0d 09 09 09 62 72 65 61 | = TRUE;|....brea|
|00002050| 6b 3b 0d 09 09 09 0d 09 | 09 63 61 73 65 20 69 6e |k;......|.case in|
|00002060| 44 72 61 67 3a 0d 0d 09 | 09 09 2f 2f 09 49 66 20 |Drag:...|..//.If |
|00002070| 74 68 65 20 64 72 61 67 | 20 72 65 67 69 6f 6e 20 |the drag| region |
|00002080| 28 74 69 74 6c 65 20 62 | 61 72 29 20 77 61 73 20 |(title b|ar) was |
|00002090| 63 6c 69 63 6b 65 64 2c | 20 63 61 6c 6c 20 22 44 |clicked,| call "D|
|000020a0| 72 61 67 57 69 6e 64 6f | 77 28 29 22 20 74 6f 20 |ragWindo|w()" to |
|000020b0| 64 72 61 67 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |drag the| window |
|000020c0| 69 6e 0d 09 09 09 2f 2f | 09 74 68 65 20 6e 6f 72 |in....//|.the nor|
|000020d0| 6d 61 6c 20 66 61 73 68 | 69 6f 6e 2e 0d 09 09 0d |mal fash|ion.....|
|000020e0| 09 09 09 44 72 61 67 57 | 69 6e 64 6f 77 20 28 67 |...DragW|indow (g|
|000020f0| 57 69 6e 64 6f 77 2c 20 | 67 54 68 65 45 76 65 6e |Window, |gTheEven|
|00002100| 74 2e 77 68 65 72 65 2c | 20 26 71 64 2e 73 63 72 |t.where,| &qd.scr|
|00002110| 65 65 6e 42 69 74 73 2e | 62 6f 75 6e 64 73 29 3b |eenBits.|bounds);|
|00002120| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 0d 09 |....brea|k;......|
|00002130| 09 63 61 73 65 20 69 6e | 43 6f 6e 74 65 6e 74 3a |.case in|Content:|
|00002140| 0d 09 09 0d 09 09 09 2f | 2f 09 49 66 20 74 68 65 |......./|/.If the|
|00002150| 20 63 6f 6e 74 65 6e 74 | 20 61 72 65 61 20 77 61 | content| area wa|
|00002160| 73 20 63 6c 69 63 6b 65 | 64 2c 20 63 61 6c 6c 20 |s clicke|d, call |
|00002170| 74 68 65 20 63 75 73 74 | 6f 6d 20 64 72 61 67 20 |the cust|om drag |
|00002180| 72 6f 75 74 69 6e 65 20 | 22 4d 79 44 72 61 67 57 |routine |"MyDragW|
|00002190| 69 6e 64 6f 77 28 29 22 | 2e 0d 09 09 09 0d 09 09 |indow()"|........|
|000021a0| 09 4d 79 44 72 61 67 57 | 69 6e 64 6f 77 20 28 29 |.MyDragW|indow ()|
|000021b0| 3b 0d 09 09 09 62 72 65 | 61 6b 3b 0d 09 7d 0d 7d |;....bre|ak;..}.}|
|000021c0| 0d 0d 0d 76 6f 69 64 20 | 48 61 6e 64 6c 65 45 76 |...void |HandleEv|
|000021d0| 65 6e 74 73 20 28 76 6f | 69 64 29 0d 0d 2f 2f 09 |ents (vo|id)..//.|
|000021e0| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 72 65 |This fun|ction re|
|000021f0| 70 65 61 74 65 64 6c 79 | 20 68 61 6e 64 6c 65 73 |peatedly| handles|
|00002200| 20 65 76 65 6e 74 73 20 | 75 6e 74 69 6c 20 74 68 | events |until th|
|00002210| 65 20 22 67 44 6f 6e 65 | 22 20 66 6c 61 67 20 69 |e "gDone|" flag i|
|00002220| 73 20 73 65 74 20 28 62 | 79 20 63 6c 6f 73 69 6e |s set (b|y closin|
|00002230| 67 20 74 68 65 20 77 69 | 6e 64 6f 77 2c 20 6f 72 |g the wi|ndow, or|
|00002240| 0d 2f 2f 09 73 65 6c 65 | 63 74 69 6e 67 20 22 43 |.//.sele|cting "C|
|00002250| 6c 6f 73 65 22 20 6f 72 | 20 22 51 75 69 74 22 20 |lose" or| "Quit" |
|00002260| 66 72 6f 6d 20 74 68 65 | 20 46 69 6c 65 20 6d 65 |from the| File me|
|00002270| 6e 75 29 2e 0d 0d 7b 0d | 09 64 6f 0d 09 7b 0d 09 |nu)...{.|.do..{..|
|00002280| 09 2f 2f 09 43 61 6c 6c | 20 22 57 61 69 74 4e 65 |.//.Call| "WaitNe|
|00002290| 78 74 45 76 65 6e 74 28 | 29 22 20 74 6f 20 67 65 |xtEvent(|)" to ge|
|000022a0| 74 20 74 68 65 20 6e 65 | 78 74 20 65 76 65 6e 74 |t the ne|xt event|
|000022b0| 2e 0d 09 09 0d 09 09 57 | 61 69 74 4e 65 78 74 45 |.......W|aitNextE|
|000022c0| 76 65 6e 74 20 28 65 76 | 65 72 79 45 76 65 6e 74 |vent (ev|eryEvent|
|000022d0| 2c 20 26 67 54 68 65 45 | 76 65 6e 74 2c 20 6b 4d |, &gTheE|vent, kM|
|000022e0| 61 78 57 61 69 74 2c 20 | 4e 55 4c 4c 29 3b 0d 09 |axWait, |NULL);..|
|000022f0| 09 73 77 69 74 63 68 20 | 28 67 54 68 65 45 76 65 |.switch |(gTheEve|
|00002300| 6e 74 2e 77 68 61 74 29 | 0d 09 09 7b 0d 09 09 09 |nt.what)|...{....|
|00002310| 63 61 73 65 20 6d 6f 75 | 73 65 44 6f 77 6e 3a 0d |case mou|seDown:.|
|00002320| 09 09 09 0d 09 09 09 09 | 2f 2f 09 49 66 20 74 68 |........|//.If th|
|00002330| 65 20 6d 6f 75 73 65 20 | 77 61 73 20 63 6c 69 63 |e mouse |was clic|
|00002340| 6b 65 64 2c 20 63 61 6c | 6c 20 22 48 61 6e 64 6c |ked, cal|l "Handl|
|00002350| 65 4d 6f 75 73 65 44 6f | 77 6e 28 29 22 2e 0d 09 |eMouseDo|wn()"...|
|00002360| 09 09 09 0d 09 09 09 09 | 48 61 6e 64 6c 65 4d 6f |........|HandleMo|
|00002370| 75 73 65 44 6f 77 6e 20 | 28 29 3b 0d 09 09 09 09 |useDown |();.....|
|00002380| 62 72 65 61 6b 3b 0d 09 | 09 09 09 0d 09 09 09 63 |break;..|.......c|
|00002390| 61 73 65 20 6b 65 79 44 | 6f 77 6e 3a 0d 09 09 09 |ase keyD|own:....|
|000023a0| 0d 09 09 09 09 2f 2f 09 | 49 66 20 61 20 6b 65 79 |.....//.|If a key|
|000023b0| 20 77 61 73 20 70 72 65 | 73 73 65 64 2c 20 63 68 | was pre|ssed, ch|
|000023c0| 65 63 6b 20 74 6f 20 73 | 65 65 20 69 66 20 74 68 |eck to s|ee if th|
|000023d0| 65 20 63 6f 6d 6d 61 6e | 64 20 6b 65 79 20 77 61 |e comman|d key wa|
|000023e0| 73 20 61 6c 73 6f 20 70 | 72 65 73 73 65 64 2e 20 |s also p|ressed. |
|000023f0| 20 49 66 20 73 6f 2c 0d | 09 09 09 09 2f 2f 09 6d | If so,.|....//.m|
|00002400| 61 73 6b 20 6f 75 74 20 | 74 68 65 20 63 68 61 72 |ask out |the char|
|00002410| 61 63 74 65 72 20 66 72 | 6f 6d 20 74 68 65 20 65 |acter fr|om the e|
|00002420| 76 65 6e 74 20 6d 65 73 | 73 61 67 65 2c 20 74 68 |vent mes|sage, th|
|00002430| 65 6e 20 63 61 6c 6c 20 | 22 4d 65 6e 75 4b 65 79 |en call |"MenuKey|
|00002440| 28 29 22 20 74 6f 20 64 | 65 74 65 72 6d 69 6e 65 |()" to d|etermine|
|00002450| 0d 09 09 09 09 2f 2f 09 | 74 68 65 20 6d 65 6e 75 |.....//.|the menu|
|00002460| 20 63 68 6f 69 63 65 20 | 61 6e 64 20 73 65 6e 64 | choice |and send|
|00002470| 20 69 74 20 74 6f 20 22 | 48 61 6e 64 6c 65 4d 65 | it to "|HandleMe|
|00002480| 6e 75 43 68 6f 69 63 65 | 28 29 22 2e 0d 09 09 09 |nuChoice|()".....|
|00002490| 09 0d 09 09 09 09 69 66 | 20 28 67 54 68 65 45 76 |......if| (gTheEv|
|000024a0| 65 6e 74 2e 6d 6f 64 69 | 66 69 65 72 73 20 26 20 |ent.modi|fiers & |
|000024b0| 63 6d 64 4b 65 79 29 0d | 09 09 09 09 09 48 61 6e |cmdKey).|.....Han|
|000024c0| 64 6c 65 4d 65 6e 75 43 | 68 6f 69 63 65 20 28 4d |dleMenuC|hoice (M|
|000024d0| 65 6e 75 4b 65 79 20 28 | 67 54 68 65 45 76 65 6e |enuKey (|gTheEven|
|000024e0| 74 2e 6d 65 73 73 61 67 | 65 20 26 20 63 68 61 72 |t.messag|e & char|
|000024f0| 43 6f 64 65 4d 61 73 6b | 29 29 3b 0d 09 09 09 09 |CodeMask|));.....|
|00002500| 62 72 65 61 6b 3b 0d 09 | 09 09 09 0d 09 09 09 63 |break;..|.......c|
|00002510| 61 73 65 20 75 70 64 61 | 74 65 45 76 74 3a 0d 09 |ase upda|teEvt:..|
|00002520| 09 09 0d 09 09 09 09 2f | 2f 09 49 66 20 61 6e 20 |......./|/.If an |
|00002530| 75 70 64 61 74 65 20 65 | 76 65 6e 74 20 77 61 73 |update e|vent was|
|00002540| 20 72 65 63 65 69 76 65 | 64 2c 20 63 61 6c 6c 20 | receive|d, call |
|00002550| 22 55 70 64 61 74 65 57 | 69 6e 64 6f 77 28 29 22 |"UpdateW|indow()"|
|00002560| 20 74 6f 20 72 65 64 72 | 61 77 20 74 68 65 20 70 | to redr|aw the p|
|00002570| 69 63 74 75 72 65 2e 0d | 09 09 09 09 0d 09 09 09 |icture..|........|
|00002580| 09 55 70 64 61 74 65 57 | 69 6e 64 6f 77 20 28 29 |.UpdateW|indow ()|
|00002590| 3b 0d 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 7d |;.....br|eak;...}|
|000025a0| 0d 09 7d 0d 09 77 68 69 | 6c 65 20 28 21 67 44 6f |..}..whi|le (!gDo|
|000025b0| 6e 65 29 3b 0d 7d 0d 0d | 0d 76 6f 69 64 20 6d 61 |ne);.}..|.void ma|
|000025c0| 69 6e 20 28 76 6f 69 64 | 29 0d 0d 2f 2f 09 54 68 |in (void|)..//.Th|
|000025d0| 65 20 6d 61 69 6e 20 66 | 75 6e 63 74 69 6f 6e 20 |e main f|unction |
|000025e0| 69 6e 69 74 69 61 6c 69 | 7a 65 73 20 65 76 65 72 |initiali|zes ever|
|000025f0| 79 74 68 69 6e 67 2c 20 | 74 68 65 6e 20 63 61 6c |ything, |then cal|
|00002600| 6c 73 20 22 48 61 6e 64 | 6c 65 45 76 65 6e 74 73 |ls "Hand|leEvents|
|00002610| 28 29 22 20 74 6f 20 70 | 72 6f 63 65 73 73 20 65 |()" to p|rocess e|
|00002620| 76 65 6e 74 73 20 75 6e | 74 69 6c 20 74 68 65 0d |vents un|til the.|
|00002630| 2f 2f 09 75 73 65 72 20 | 71 75 69 74 73 2e 0d 0d |//.user |quits...|
|00002640| 7b 0d 09 54 6f 6f 6c 62 | 6f 78 49 6e 69 74 20 28 |{..Toolb|oxInit (|
|00002650| 29 3b 09 09 09 2f 2f 20 | 20 69 6e 69 74 69 61 6c |);...// | initial|
|00002660| 69 7a 65 20 74 68 65 20 | 4d 61 63 69 6e 74 6f 73 |ize the |Macintos|
|00002670| 68 20 54 6f 6f 6c 62 6f | 78 0d 09 4d 65 6e 75 49 |h Toolbo|x..MenuI|
|00002680| 6e 69 74 20 28 29 3b 09 | 09 09 2f 2f 20 20 64 72 |nit ();.|..// dr|
|00002690| 61 77 20 74 68 65 20 6d | 65 6e 75 20 62 61 72 0d |aw the m|enu bar.|
|000026a0| 09 44 72 61 77 57 69 6e | 64 6f 77 20 28 29 3b 09 |.DrawWin|dow ();.|
|000026b0| 09 2f 2f 20 20 64 72 61 | 77 20 74 68 65 20 77 69 |.// dra|w the wi|
|000026c0| 6e 64 6f 77 0d 09 48 61 | 6e 64 6c 65 45 76 65 6e |ndow..Ha|ndleEven|
|000026d0| 74 73 20 28 29 3b 09 09 | 2f 2f 20 20 68 61 6e 64 |ts ();..|// hand|
|000026e0| 6c 65 20 65 76 65 6e 74 | 73 0d 7d 0d 00 00 00 00 |le event|s.}.....|
|000026f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002700| 00 00 01 00 00 00 01 14 | 00 00 00 14 00 00 00 46 |........|.......F|
|00002710| 00 1f ff fe 00 1f ff ff | 00 1f ff ff 80 1f ff ff |........|........|
|00002720| c0 1f ff ff e0 1f ff ff | f0 1f ff ff f0 1f ff ff |........|........|
|00002730| 0a 44 72 61 67 44 65 6d | 6f 2e 63 00 02 00 00 00 |.DragDem|o.c.....|
|00002740| 54 45 58 54 4b 41 48 4c | 01 00 00 00 00 40 00 00 |TEXTKAHL|.....@..|
|00002750| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 00 00 40 |..TEXTKA|HL.....@|
|00002760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002770| 00 00 ab 50 81 65 00 00 | 26 6c 00 00 01 5a ff ff |...P.e..|&l...Z..|
|00002780| f0 1f ff ff f0 1f ff ff | f0 00 00 01 00 00 00 00 |........|........|
|00002790| 00 07 ff ff e0 08 00 00 | 10 08 00 00 10 08 ff ff |........|........|
|000027a0| 10 09 00 00 90 09 55 50 | 90 09 00 00 90 09 55 00 |......UP|......U.|
|000027b0| 90 09 00 00 90 09 50 00 | 90 09 00 00 90 09 50 00 |......P.|......P.|
|000027c0| 90 09 00 00 90 09 54 00 | 90 09 00 00 90 09 00 00 |......T.|........|
|000027d0| 90 08 ff ff 10 08 00 00 | 10 08 00 00 10 08 00 00 |........|........|
|000027e0| 10 08 00 00 10 08 00 ff | 10 08 00 00 10 08 00 00 |........|........|
|000027f0| 10 08 00 00 10 08 00 00 | 10 07 ff ff e0 04 00 00 |........|........|
|00002800| 00 00 00 04 00 06 00 04 | 00 00 00 08 00 0c 05 54 |........|.......T|
|00002810| 69 6d 65 73 00 00 01 00 | 00 00 01 14 00 00 00 14 |imes....|........|
|00002820| 00 00 00 46 00 39 af 14 | 03 ae 00 00 00 1c 00 46 |...F.9..|.......F|
|00002830| 00 01 45 54 41 42 00 00 | 00 12 45 46 4e 54 00 00 |..ETAB..|..EFNT..|
|00002840| 00 1e 03 ec ff ff 00 00 | 00 00 00 39 ae 0c 03 eb |........|...9....|
|00002850| ff ff 00 00 00 08 00 39 | ad 54 00 00 00 00 00 00 |.......9|.T......|
|00002860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+